package stephen.teamwork14;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class BaseDao {
     String driver="com.mysql.jbdc.Driver";
     String database="java3";
     String userName="root";
     String password=null;
     String url="jdbc:mysql://localhost:3306/"+database+"?useUnicode=true&characterEncoding=UTF-8";
     Connection con=null;
     
     public Connection getCon()  {
    	 
    	 try {
    		 Class.forName(driver);
			con=DriverManager.getConnection(url,userName,password);
		} catch (SQLException | ClassNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
    	 return con;
     }
}
